package com.jet.core.annotation;


import com.jet.core.validation.PasswordValidator;

import javax.validation.Constraint;
import javax.validation.Payload;
import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;

/**
 * @author dcl
 * @since 2025/4/1 11:45
 */
@Constraint(validatedBy = {PasswordValidator.class})
@Target({ElementType.METHOD, ElementType.FIELD})
@Retention(RetentionPolicy.RUNTIME)
public @interface Password {

    String message() default "密码格式错误，必须为6到18位包含大小写字母、数字和特殊字符";

    // 至少6位包含大小写字母、数字和特殊字符
    String regex() default PasswordValidator.DEFAULT_REGEX;

    Class<?>[] groups() default {};

    Class<? extends Payload>[] payload() default {};
}
